<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="com.niit.Book" %>       
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>注册</title>
</head>
<body>
<% String username = (String) session.getAttribute("username"); %>
<h1>登录成功，欢迎 <%= username %></h1>

<table border=1>
	<tr>
		<th>编号</th>
		<th>书名</th>
		<th>作者</th>
	</tr>
	
	<%
		List<Book> books = (List<Book>)request.getAttribute("lstBooks");
		for(Book item:books){
			// 把数据放到request中，方便jsp页面通过el表达式取出来
			request.setAttribute("book", item);	
		
	%>
	
	<tr>
		<td>${book.id}</td>
		<td>${book.name}</td>
		<td>${book.author}</td>
	</tr>
	
	<% 
		} 
	%>
	
</table>

</body>
</html>